package com.ns.matrimonial.controller;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;

import com.ns.matrimonial.view.LoginView;

@ManagedBean(name = "loginController")
@SessionScoped
public class LoginController implements Serializable {

	private static final long serialVersionUID = 1L;

	@ManagedProperty(value = "#{loginView}")
	private LoginView loginView;

	public void loginUser() {
		System.out.println("Success");
	}

	/**
	 * @return the loginView
	 */
	public LoginView getLoginView() {
		return loginView;
	}

	/**
	 * @param loginView
	 *            the loginView to set
	 */
	public void setLoginView(LoginView loginView) {
		this.loginView = loginView;
	}

	public void testBtnEventListener(ActionEvent event){
		System.out.println("Test Btn Fired 123>>> "+getLoginView().getUserName());
		getLoginView().setUserName("Pankaj Test");
	}
}
